// Decompiled by DJ v3.7.7.81 Copyright 2004 Atanas Neshkov  Date: 2007-9-15 18:53:51

// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   hu.java

package com.zelix;

import java.io.*;
import java.util.Hashtable;

// Referenced classes of package com.zelix:
//            kt, is, zs, sm, 
//            qy, jb, jm

class hu extends kt
    implements sm
{

    boolean k;
    int l;
    int m;
    zs n;
    zs o;
    int p;
    byte q[];

    private hu(kt kt1, int i, int j, int i1, int j1, int k1)
    {
        super(kt1);
        k = true;
        k = false;
        l = i;
        m = j;
        p = k1;
        a(i1, j1);
    }

    hu(kt kt1, jb jb, qy qy1)
        throws IOException
    {
label0:
        {
            super(kt1);
            k = true;
            l = jb.readUnsignedShort();
            m = jb.readUnsignedShort();
            int i = jb.readUnsignedShort();
            int j = jb.readUnsignedShort();
            p = jb.readUnsignedShort();
            is is1 = a(i);
            is is2 = a(j);
            if((is1 instanceof zs) && (is2 instanceof zs))
            {
                n = (zs)is1;
                o = (zs)is2;
                qy1.b(n, this);
                qy1.b(o, this);
                if(kt.i == 0)
                    break label0;
            }
            k = false;
            a(i, j);
        }
    }

    public void a(zs zs1, zs zs2)
    {
label0:
        {
            if(n == zs1)
            {
                n = zs2;
                if(kt.i == 0)
                    break label0;
            }
            if(o == zs1)
                o = zs2;
        }
    }

    static hu a(kt kt1, jm jm)
    {
        return new hu(kt1, 0, 0, 0, 0, 32767);
    }

    void a(Hashtable hashtable)
    {
        if(k)
        {
            hashtable.put(n, this);
            hashtable.put(o, this);
        }
    }

    private void a(int i, int j)
    {
        q = new byte[10];
        q[0] = (byte)(l >>> 8 & 0xff);
        q[1] = (byte)(l & 0xff);
        q[2] = (byte)(m >>> 8 & 0xff);
        q[3] = (byte)(m & 0xff);
        q[4] = (byte)(i >>> 8 & 0xff);
        q[5] = (byte)(i & 0xff);
        q[6] = (byte)(j >>> 8 & 0xff);
        q[7] = (byte)(j & 0xff);
        q[8] = (byte)(p >>> 8 & 0xff);
        q[9] = (byte)(p & 0xff);
    }

    protected void a(DataOutputStream dataoutputstream)
        throws IOException
    {
label0:
        {
            if(k)
            {
                dataoutputstream.writeShort(l);
                dataoutputstream.writeShort(m);
                dataoutputstream.writeShort(n.j());
                dataoutputstream.writeShort(o.j());
                dataoutputstream.writeShort(p);
                if(kt.i == 0)
                    break label0;
            }
            dataoutputstream.write(q);
        }
    }

    protected void a(DataOutputStream dataoutputstream, Hashtable hashtable)
        throws IOException
    {
        int i;
label0:
        {
            i = kt.i;
            dataoutputstream.writeShort(l);
            dataoutputstream.writeShort(m);
            zs zs1 = (zs)hashtable.get(n);
            if(zs1 != null)
            {
                dataoutputstream.writeShort(zs1.j());
                if(i == 0)
                    break label0;
            }
            dataoutputstream.writeShort(n.j());
        }
label1:
        {
            zs zs2 = (zs)hashtable.get(o);
            if(zs2 != null)
            {
                dataoutputstream.writeShort(zs2.j());
                if(i == 0)
                    break label1;
            }
            dataoutputstream.writeShort(o.j());
        }
        dataoutputstream.writeShort(p);
    }
}